<template>
	<view class="bg">
		<view class="list">
			<u-cell-group :border='false'>
				<u-cell title="修改头像">
					<u-upload :fileList="fileList1" slot="right-icon" @afterRead="afterRead" @delete="deletePic" name="1" multiple
						:maxCount="10"></u-upload>
					<u-icon slot="right-icon" size="32" color="#858BA3" name="arrow-right"></u-icon>
				</u-cell>
				<u-cell title="姓名" value="用户01">
					<u-icon slot="right-icon" size="32" color="#858BA3" name="arrow-right"></u-icon>
				</u-cell>
				<u-cell title="邮箱" value="2497134212@qq.com">
					<u-icon slot="right-icon" size="32" color="#858BA3" name="arrow-right"></u-icon>
				</u-cell>
				<u-cell title="手机号码" value="12345678910">
					<u-icon slot="right-icon" size="32" color="#858BA3" name="arrow-right"></u-icon>
				</u-cell>
			</u-cell-group>
		</view>
		<view class="btn juedui" style="margin-top: 271rpx;">
			<u-button text="退出登录" shape="circle"
				color="linear-gradient(to right, rgb(254, 199, 130), rgb(239, 224, 201))"></u-button>
		</view>
	</view>
</template>

<script>
	import axios from 'axios'
	export default {
		data() {
			return {

			}
		},
		onLoad(option) {

		},
		methods: {
			qylist() {
				var that = this
				// 我的权益列表
				axios({
					url: ' http://equity.njyyl.net/gen/uservip/front/mylist',
					params: {
						phone: uni.getStorageSync('phone'),
						status: 0
					},
					headers: {
						Authorization: uni.getStorageSync('token'),
					},
				}).then(res => {
					console.log(res);
					that.list = res.data.rows
				})
			},
			click(e) {
				console.log(e)
				for (let i = 0; i < this.list1.length; i++) {
					if (i == this.current) {
						window.location.href = this.list1[i].link
					}
				}

			},
			aa(e) {
				console.log(e.current)
				this.current = e.current
			},
			home() {
				uni.navigateTo({
					url: '/pages/index/index'
				})
			},
			remen() {
				uni.navigateTo({
					url: '/pages/index/problem'
				})
			},
			jilu() {
				uni.navigateTo({
					url: '/pages/exchange/record'
				})
			},
			formatDate(value) {
				if (value == undefined) {
					return;
				}
				let date = new Date(value * 1000);
				// let date = new Date(value);
				//时间戳为10位需*1000，时间戳为13位的话不需乘1000
				let y = date.getFullYear();
				let MM = date.getMonth() + 1;
				MM = MM < 10 ? ('0' + MM) : MM; //月补0
				let d = date.getDate();
				d = d < 10 ? ('0' + d) : d; //天补0
				// let h = date.getHours();
				// h = h < 10 ? ('0' + h) : h; //小时补0
				// let m = date.getMinutes();
				// m = m < 10 ? ('0' + m) : m; //分钟补0
				// let s = date.getSeconds();
				// s = s < 10 ? ('0' + s) : s; //秒补0
				// return y + '-' + MM + '-' + d; //年月日
				return y + '-' + MM + '-' + d + ' ';
				// return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; 
			},
			duihuan(e, i, y, a, b) {
				console.log(e, i, y)
				this.show = true
				this.code = i
				this.content = e
				this.id = y
				this.kaishi = a
				this.jieshu = b
			},
			quit() {
				this.show = false
			},
			confirm() {
				var that = this
				that.showma = true
				that.show = false
				// 我的权益列表
				axios({
					url: ' http://equity.njyyl.net/gen/uservip/front/update',
					params: {
						id: that.id
					},
					headers: {
						Authorization: uni.getStorageSync('token'),
					},
				}).then(res => {
					console.log(res);
					// that.list = res.data.rows
					if (res.data.code == 200) {
						uni.showToast({
							title: '兑换成功~',
							icon: 'none',
							duration: 2000
						})
						that.qylist()
					} else {
						uni.showToast({
							title: res.data.msg,
							icon: 'none',
							duration: 2000
						})
					}
				})
			},
			open() {
				// console.log('open');
			},
			close() {
				this.showma = false
				// console.log('close');
			},
			opena() {
				// console.log('open');
			},
			closea() {
				this.show = false
				// console.log('close');
			},
			copy(value) {
				uni.setClipboardData({
					data: value, //要被复制的内容
					success: () => { //复制成功的回调函数
						this.showma = false
						uni.showToast({
							title: '复制成功~',
							icon: 'none',
							duration: 2000
						})
					},

				});
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #30324C;
	}

	.u-line {
		border-bottom: 3rpx solid #20243C !important;
	}

	.u-cell__title-text {
		color: #FFFFFF !important;
	}

	.u-cell__value {
		color: #858BA3 !important;
	}

	.u-cell__body {
		padding: 48rpx 0 !important;
	}

	.u-cell__left-icon-wrap {
		margin-right: 31.5rpx !important;
	}

	.bg {
		width: 100%;

		.list {
			width: 100%;

			margin: 0 auto;
		}

		.tishi {
			color: #F5C7A6;
			font-size: 28rpx;
			text-align: center;
			margin-bottom: 49rpx;

			.nihao {
				width: 100%;
				margin-bottom: 16rpx;
			}

			image {
				width: 44rpx;
				height: 39rpx;
				margin-right: 16rpx;
			}
		}

		.erweima {
			width: 100%;
			text-align: center;
			margin: 50rpx 0;

			image {
				width: 262rpx;
				height: 262rpx;
			}
		}

		.list {
			position: relative;
			width: 90%;
			margin: 0 auto;

			image {
				width: 100%;
				height: 220rpx;
			}

			.fdright {
				position: absolute;
				top: 0;
				right: 0;
				margin: auto;
				padding: 23rpx;
				box-sizing: border-box;

				.txt {
					width: 244rpx;
					font-size: 24rpx;
					margin-top: 24rpx;

					.name {
						font-weight: 600;
						font-size: 32rpx;
					}

					.time {
						margin: 12rpx 0 9rpx 0;
					}
				}

				.btn {
					background-color: #424A6F;
					color: #FBFBFB;
					font-size: 28rpx;
					border-radius: 28rpx;
					padding: 11rpx 24rpx;
					margin-left: 35rpx;
					box-sizing: border-box;
				}
			}
		}
	}

	a {
		text-decoration: none;
		color: #333;
	}

	a:hover,
	a:visited,
	a:link,
	a:active {
		color: #F5C7A6;
		// 设置使所有a标签的四种状态都和本身颜色保持一致，样式代码自己写
	}


	/deep/ .u-popup__content[data-v-52d4ddd1] {
		border-radius: 36rpx !important;
		width: 590rpx !important;
		box-sizing: border-box !important;
		background-color: rgba(66, 71, 101, 0) !important;
	}

	.tankuang {
		background-color: #424765 !important;
		border-radius: 36rpx !important;
		width: 590rpx !important;
		padding: 47rpx 32rpx 32rpx 32rpx !important;
		box-sizing: border-box !important;
	}

	/deep/.u-demo-block__content {
		margin: 24rpx 0 12rpx 0 !important;
		border: 1px solid #F5C7A6 !important;
		border-radius: 50rpx !important;
	}

	/deep/.u-popup__content[data-v-63bc9907] {
		background-color: rgba(255, 255, 255, 0) !important;
	}
</style>